from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter

from goods import views

urlpatterns = [

    # 列表界面面包屑导航
    url(r'categories/(?P<pk>\d+)/$',views.CategoryView.as_view()),
    # 排序 查询商品列表数据　方式１
    url(r'^categories/(?P<category_id>\d+)/skus/$', views.SKUListView.as_view()),
    # 排序过滤　查询商品列表数据　方式２
    url(r'^skus/$', views.SKUListView2.as_view()),


]

# 商品全文检索的路由配置
router = DefaultRouter()
# 访问的路由地址类似：　/skus/search/?text=wifi
router.register('skus/search', views.SKUSearchViewSet, base_name='sku_search')

urlpatterns += router.urls